const state = {
  markers: [],
  currentDeviceType: null
}

const mutations = {
  SET_MARKERS(state, markers) {
    state.markers = markers
  },
  SET_CURRENT_DEVICE_TYPE(state, deviceType) {
    state.currentDeviceType = deviceType
  },
  CLEAR_MARKERS(state) {
    state.markers = []
  }
}

const actions = {
  updateMarkers({ commit }, { markers, deviceType }) {
    commit('SET_MARKERS', markers)
    commit('SET_CURRENT_DEVICE_TYPE', deviceType)
  },
  clearMarkers({ commit }) {
    commit('CLEAR_MARKERS')
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
} 